﻿using System;
using System.Collections;

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue queue = new Queue();
            queue.Enqueue("你是人间四月天");
            queue.Enqueue("April");
            queue.Enqueue(4);

            //方法1
            while (queue.Count != 0)
            {
                Console.WriteLine(queue.Dequeue());
            }

            //方法2
            var arr = queue.ToArray();
            foreach(var item in arr)
            {
                Console.WriteLine(item);
            }

            //方法3
            var gentor = queue.GetEnumerator();
            while (gentor.MoveNext())
            {
                Console.WriteLine(gentor.Current);
            }
        }
    }
}
